<?php
	if(isset($_POST['password']) && isset($_POST['passwordnew']) && isset($_POST['passwordnew2'])){
		$password		= $func->html_post('password');
		$passwordnew	= $func->html_post('passwordnew');
		$passwordnew2	= $func->html_post('passwordnew2');
		
		if(strlen(trim($passwordnew))<5 || strlen($passwordnew)>50){
			$func->SetSession('user_fasle',$config_nc->PassWordNewfail);
		}else if($passwordnew!=$passwordnew2){
			$func->SetSession('user_fasle',$config_nc->PassWordRefail);
		}else{
			$Result	= $useradmin_class->GetByName($WEB_UserAdmin);
			if(is_array($Result)){		
				if($Result[0]['password']==md5($password)){	
					$KQ	= $useradmin_class->EditPass($WEB_UserAdmin,md5($password));	
					if($KQ==1){
						$func->SetSession('user_fasle',$config_nc->Successful);
					}else{
						$func->SetSession('user_fasle',$config_nc->Error);
					}
				}else{
					$func->SetSession('user_fasle',$config_nc->PassWordfail);
				}
			}else{
				$func->SetSession('user_fasle',$config_nc->Error_login);
			}
		}		
	}
	header('location:'.$WEB_DOMAIN.'/'.$WEB_ADMIN.'/index.php?u1=my-account');

?>
